package server.domain;

import java.net.Socket;
import java.util.LinkedList;
import java.util.Queue;

/**
 * Stores server-relevant information of the user.
 * 
 * @author Lukas
 *
 */
public class User {
	private boolean online;
	private int udpPort;
	private Socket socket;
	private Queue<String> messageQueue;
	
	/**
	 * @return if online
	 */
	public boolean isOnline() {
		return online;
	}

	/**
	 * @param online sets whether the user is online
	 */
	public void setOnline(boolean online) {
		this.online = online;
	}

	/**
	 * @return the udpPort
	 */
	public int getUdpPort() {
		return udpPort;
	}

	/**
	 * @param udpPort the udpPort to set
	 */
	public void setUdpPort(int udpPort) {
		this.udpPort = udpPort;
	}

	/**
	 * @return the socket
	 */
	public Socket getSocket() {
		return socket;
	}

	/**
	 * @param socket the socket to set
	 */
	public void setSocket(Socket socket) {
		this.socket = socket;
	}

	/**
	 * @return the message queue
	 */
	public Queue<String> getMessageQueue() {
		if (messageQueue == null) {
			messageQueue = new LinkedList<String>();
		}
		return messageQueue;
	}
}
